<h1>New record</h1>

<% form_for(@record) do |f| %>
  <%= f.error_messages %>

  <p>
    <%= f.label :date %><br />
    <%= f.date_select :date %>
  </p>
  <p>
    <%= f.label :length %><br />
    <%= f.text_field :length %>
  </p>

  <p>
    <%= f.label :task_id %><br />
    <select name="record[task_id]">
	<% @tasks.each do |task| %>
	       <option value="<%= task.id %>">
		<%= task.name %>
	       </option>
	<% end %>
	</select>
  </p>
  <p>
    <%= f.label :project_id %><br />
    <select name="record[project_id]">
	<% @projects.each do |project| %>
	       <option value="<%= project.id %>">
		<%= project.project_reference %>
	       </option>
	<% end %>
	</select>
  </p>

  <p>
	    <%= f.label :description %><br />
	    <%= f.text_field :description %>
	</p>
    <%= f.submit 'Create' %>
  </p>
<% end %>

<%= link_to 'Back', records_path %>